package com.huitone.smspfm.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.bin.common.utils.DateTimeUtils;
import com.bin.common.utils.StringUtils;

/**   
* @Title SMAffixHash.java 
* @Package com.huitone.smspfm.model 
* @Description TODO(用一句话描述该文件做什么) 
* @author ybliang   
* @date 2017年5月16日 下午5:13:09 
* @version V1.0   
*/
public class SMAffixHash {

	private String svrNode;
	private String serviceCode;
	private String moSm;
	private Integer timeLen;
	private Date processTime;
	
	public static List<Object> getColumns() {
		List<Object> list = new ArrayList<>();
		list.add("SvrNode");
		list.add("ServiceCode");
		list.add("MoSm");
		list.add("TimeLen");
		list.add("ProcessTime");
		return list;
	}
	
	public static SMAffixHash build(List<Object> list) {
		
		SMAffixHash affixHash = null;
		
		if (list != null && list.size() == 5) {
			try {
				affixHash = new SMAffixHash();
				affixHash.setSvrNode(StringUtils.toString(list.get(0)));
				affixHash.setServiceCode(StringUtils.toString(list.get(1)));
				affixHash.setMoSm(StringUtils.toString(list.get(2)));
				affixHash.setTimeLen(StringUtils.toInteger(list.get(3)));
				affixHash.setProcessTime(DateTimeUtils.strToDate(StringUtils.toString(list.get(4)), "yyyyMMddHHmmss"));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
		return affixHash;
	}
	
	public String getSvrNode() {
		return svrNode;
	}
	public void setSvrNode(String svrNode) {
		this.svrNode = svrNode;
	}
	public String getServiceCode() {
		return serviceCode;
	}
	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}
	public String getMoSm() {
		return moSm;
	}
	public void setMoSm(String moSm) {
		this.moSm = moSm;
	}
	public Integer getTimeLen() {
		return timeLen;
	}
	public void setTimeLen(Integer timeLen) {
		this.timeLen = timeLen;
	}
	public Date getProcessTime() {
		return processTime;
	}
	public void setProcessTime(Date processTime) {
		this.processTime = processTime;
	}

	@Override
	public String toString() {
		return "SMAffixHash [svrNode=" + svrNode + ", serviceCode=" + serviceCode + ", moSm=" + moSm + ", timeLen="
				+ timeLen + ", processTime=" + processTime + "]";
	}
}
